** Replication do-file for Holtermann, "Diversionary Rebel Violence in Territorial Civil War" 

** GLOBAL ANALYSIS **
*Table 1. Negative Binomial Models of Rebel Violence Outside the Disputed Area
xtset newdyadid week
*1.
xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
*2.
xtnbreg nbrebosvevent l1miloffnew  l1reblossi  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
*3.
xtnbreg nbrebosvevent l1miloffnew l1rebmingovfat_olint  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr
*4.
xtnbreg nbrebosvevent postmiloffnew l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
*5. 
xtnbreg nbrebosvevent l1miloffnew##ccnew   l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr
*6.
xtnbreg nbrebosvevent l1miloffnew##bmr_dem   l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr
*7. 
xtnbreg nbrebosvevent l1miloffnew##asymcom5   l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr


*Figure 1. Average predictive margins for military offensive conditional on other factors
use global_distweek.dta, clear
xtset newdyadid week
*Central command interaction
quietly xtnbreg nbrebosvevent i.l1miloffnew##i.ccnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog  
margins ,  predict(nu0)  at(l1miloffnew=(0 1) ccnew=(0 1) (asobserved)    l1nbcombatevent l1govosvevent l1.nbrebosveventdum  ) 
marginsplot, noci title("") xtitle("Military offensive, t-1", size(medlarge))  plot(, lab("No central command" "Central command" ) ) legend(rows(2)) yscale(range(0 0.05)) ylabel(#6)  xsize(2) ysize(3)  ytitle("")  graphregion(color(white))  aspectratio(2)
*Democracy interaction 
xtnbreg nbrebosvevent i.l1miloffnew##i.bmr_dem  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog  
margins ,  predict(nu0)  at(l1miloffnew=(0 1) bmr_dem=(0 1) (asobserved)    l1nbcombatevent l1govosvevent l1.nbrebosveventdum  ) 
marginsplot, noci  title("") plot( , lab("Autocracy" "Democracy" )  ) xtitle("Military offensive, t-1", size(medlarge)) legend(rows(2)) yscale(range(0 0.05)) ylabel(#6) ytitle("") xsize(2) ysize(3) aspectratio(2)
*Asymmetry interaction 
quietly xtnbreg nbrebosvevent i.l1miloffnew##i.asymcom5  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog  
margins ,  predict(nu0)  at(l1miloffnew=(0 1) asymcom5=(0 1) (asobserved)    l1nbcombatevent l1govosvevent l1.nbrebosveventdum  ) 
marginsplot, noci title("") xtitle("Military offensive, t-1", size(medlarge))  plot(, lab("Symmetry" "Asymmetry")) legend(rows(2)) yscale(range(0 0.05))  ytitle("") xsize(2) ysize(3) aspectratio(2) ylabel(#6) 


*NB: Figure 2 plots the coefficients from Tables A5 and A6 (see below, Online Appendix Tables)


*Figure 3. Military offensive coefficients when excluding dyads
use global_distweek.dta, clear
xtset newdyadid week
est clear
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="AMB", nolog irr 
est store _m1
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="ASG", nolog irr 
est store _m2
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="BLA", nolog irr 
est store _m3
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Chechen Republic of Ichkeria", nolog irr 
est store _m4
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Forces of the Caucasus Emirate", nolog irr 
est store _m5
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Hamas", nolog irr 
est store _m6
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Kashmir insurgents", nolog irr 
est store _m7
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="LTTE", nolog irr 
est store _m8
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="MILF", nolog irr 
est store _m9
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="NDFB", nolog irr 
est store _m10
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="NLFT", nolog irr 
est store _m11
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="PIJ", nolog irr 
est store _m12
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="PKK", nolog irr 
est store _m13
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Republic of Abkhazia", nolog irr 
est store _m14
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="Sikh insurgents", nolog irr 
est store _m15
eststo: xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   if namreb!="ULFA", nolog irr 
est store _m16
coefplot (_m1, keep (l1miloffnew) aseq(Al-Aqsa Martyrs Brigade (Israel)))  (_m2, keep (l1miloffnew) aseq(Abu Sayyaf Group (Philippines))) ///
	(_m3, keep (l1miloffnew ) aseq(Balochistan Liberation Army (Pakistan))) (_m4, keep (l1miloffnew ) aseq(Chechen Republic of Ichkeria (Russia))) ///
	(_m5, keep (l1miloffnew ) aseq(Forces of the Caucasus Emirate (Russia))) (_m6, keep (l1miloffnew ) aseq(Hamas (Israel))) ///
	(_m7, keep (l1miloffnew ) aseq(Kashmir insurgents (India))) (_m13, keep (l1miloffnew ) aseq(Kurdistan Workers' Party, PKK (Turkey)))  ///
	(_m8, keep (l1miloffnew ) aseq(Liberation Tigers of Tamil Eelam (Sri Lanka))) (_m9, keep (l1miloffnew ) aseq(Moro Islamic Liberation Front (Philippines))) ///
	(_m10, keep (l1miloffnew ) aseq(National Democratic Front of Boroland (India))) (_m11, keep (l1miloffnew ) aseq(National Liberation Front of Tripura (India))) ///
	(_m12, keep (l1miloffnew ) aseq(Palestinian Islamic Jihad (Israel))) (_m14, keep (l1miloffnew ) aseq(Republic of Abkhazia (Georgia))) ///
	(_m15, keep (l1miloffnew ) aseq(Sikh insurgents (India)))	(_m16, keep (l1miloffnew ) aseq(United Liberation Front of Assam (India))) ///
	, aseq  swapnames eform(l1miloffnew ) xtitle("Incidence-rate ratio for military offensive")  xline(1) xlabel(#5) xscale(range(1 5))  nooffset xsize(6) mcolor(black) ciopts(lcolor(black)) msymbol(circle)

	
*Figure 4. Military offensive coefficients for the LTTE and the full sample
use global_distweek.dta, clear
est clear
*full sample
xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
est store _M3Fullsample
*LTTE
nbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum if namreb=="LTTE" & week>(tw(1990w48)) , nolog irr 
est store _M3OnlyLTTElimtime
coefplot (_M3Fullsample, keep (l1miloffnew ) )   (_M3OnlyLTTElimtime, keep (l1miloffnew )) ///
		, aseq swapnames eform(l1miloffnew) xtitle("Incidence-rate ratio")   xline(1) xscale(r(0 9) )  xlabel(#10)  eqrename(_M3OnlyLTTE="M3 LTTE") nooffset aspectratio(0.5,  placement(center)) ciopts(lcolor(black)) msymbol(circle) mcolor(black)
		
		
** EELAM WARS ANALYSIS **		
*Table 2. Negative Binomial Models of LTTE Violence Outside the Disputed Area
 use eelamwars_distweek.dta, clear
tsset week
est clear
*16
nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew   l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebosvdum    , nolog irr robust
*17
 nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew   l1allrebloss  l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebosvdum    , nolog irr robust
*18
nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew  l1rebmingovfat_olint  l1allnoneelamcombatevent l1allgovonesideducdp  cfire2 l1allnoneelamrebosvdum      , nolog irr robust
*19
 nbreg allnoneelamrebosv postgovoff    l1allnoneelamcombatevent l1allgovonesideducdp  cfire2 l1allnoneelamrebosvdum      , nolog irr robust

 
	
*** ONLINE APPENDIX **
*Table A2. Summary statistics
use global_distweek.dta, clear
sum nbrebosvevent l1miloffnew  postmiloffnew l1reblossi l1rebmingovfat_olint ccnew asymcom5 bmr_dem l1nbcombatevent l1govosvevent 

*Table A3. Correlation matrix
use global_distweek.dta, clear
cor nbrebosvevent l1miloffnew  postmiloffnew l1reblossi l1rebmingovfat_olint l1nbcombatevent l1govosvevent l1nbrebosveventdum ccnew asymcom5 bmr_dem , matrix


*Table A5. Robustness Tests: Alternative Military Offensive Measures
use global_distweek.dta, clear
xtset newdyadid week
xtnbreg nbrebosvevent l1miloff_5tres l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
xtnbreg nbrebosvevent l1miloff_20tres l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
xtnbreg nbrebosvevent l1.hicombat_fatnew2 l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 

	
*Table A6. Robustness Tests: Alternative Model Specifications and Estimators
use global_distweek.dta, clear
xtset newdyadid week
*control for rainy season
xtnbreg nbrebosvevent l1miloffnew rainhi l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr 
*control for troop vars
xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent l1.nbrebosveventdum  l1.lgovtroopsi l1.lrebtroopse , nolog irr  	
*no lagged DV
xtnbreg nbrebosvevent l1miloffnew  l1nbcombatevent l1govosvevent , nolog irr  	
*NBREG FE model
xtnbreg nbrebosvevent l1miloffnew l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr fe
*POISSON FE model
xtpoisson nbrebosvevent l1miloffnew l1nbcombatevent l1govosvevent l1.nbrebosveventdum   , nolog irr fe robust


*Table B1. Summary Statistics, Eelam Wars
 use eelamwars_distweek.dta, clear
 sum  allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew   postgovoff l1allrebloss l1rebmingovfat_olint   l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebosvdum  

*Table B2. Correlation matrix
use eelamwars_distweek.dta, clear
cor allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew   postgovoff l1allrebloss l1rebmingovfat_olint   l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebosvdum   
 
*Table B3. Robustness Tests for Analysis of LTTE Violence Outside the Disputed Area 
 ** Table 1:
 use eelamwars_distweek.dta, clear
* Model with more restictive offensive coding
nbreg allnoneelamrebosv l1govoff_fat2  rebeloff_fat2    l1allnoneelamcombatevent l1allgovonesideducdp  cfire2 l1allnoneelamrebosvdum      , nolog irr robust
*rainy season control: (on M3)
nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew rainhi   l1allnoneelamcombatevent l1allgovonesideducdp  cfire2 l1allnoneelamrebosvdum      , nolog irr robust
*include troops measures (same measures as in global analysis)
nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew lrebtroopsucdp lgovtroopswb  l1allnoneelamcombatevent l1allgovonesideducdp  cfire2 l1allnoneelamrebosvdum      , nolog irr robust
*Model without lagged DV
nbreg allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew    l1allnoneelamcombatevent l1allgovonesideducdp  cfire2       , nolog irr robust
*Poisson estimator
poisson allnoneelamrebosv l1govoff_fatnew rebeloff_fatnew   l1allnoneelamcombatevent l1allgovonesideducdp  cfire2  l1allnoneelamrebosvdum , nolog irr robust


*Table B4. Additional Analysis: LTTE Attacks Outside the Disputed Area
use eelamwars_distweek.dta, clear
*Test using all rebel attacks outside eelam as DV
 nbreg allnoneelamrebattall l1govoff_fatnew rebeloff_fatnew   l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebattalldum    , nolog irr robust
*rebel attacks exluding osv:
nbreg allnoneelamrebelattack l1govoff_fatnew rebeloff_fatnew   l1allnoneelamcombatevent l1allgovonesideducdp cfire2 l1allnoneelamrebelattackdum    , nolog irr robust


 